import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        // 页面
        {
            path: '/',
            name: '/',
            component: () => import('../views/index.vue'),
            children: [
                {
                    path: '/audioLibrary',
                    name: 'audioLibrary',
                    component: () => import('../components/Page/AudioLibrary.vue')
                },
                {
                    path: '/likePlayList',
                    name: 'likePlayList',
                    component: () => import('../components/Page/LikePlayList.vue')
                },
                {
                    path: '/collectPlayList',
                    name: 'collectPlayList',
                    component: () => import('../components/Page/CollectPlayList.vue')
                },
                {
                    path: '/localPlayList',
                    name: 'localPlayList',
                    component: () => import('../components/Page/LocalPlayList.vue')
                },
                {
                    path: '/cloudPlayList',
                    name: 'cloudPlayList',
                    component: () => import('../components/Page/CloudPlayList.vue')
                },
                {
                    path: '/friends',
                    name: 'friends',
                    component: () => import('../components/Page/Friends.vue')
                }
            ]
        },
        // 用户
        {
            path: '/user',
            name: 'user',
            component: () => import('../views/user.vue'),
            children: [
                {
                    path: '/registerOrLogin',
                    name: 'registerOrLogin',
                    component: () => import('../components/User/RegisterOrLogin.vue')
                },
                {
                    path: '/userInfo',
                    name: 'userInfo',
                    component: () => import('../components/User/UserInfo.vue')
                }
            ]
        },
        // 设置
        {
            path: '/set',
            name: 'set',
            component: () => import('../views/set.vue'),
            children: [
                {
                    path: '/backgroundManagement',
                    name: 'backgroundManagement',
                    component: () => import('../components/Set/BackgroundManagement.vue')
                },
                {
                    path: '/keyboardListen',
                    name: 'keyboardListen',
                    component: () => import('../components/Set/KeyboardListen.vue')
                },
                {
                    path: '/systemConfig',
                    name: 'systemConfig',
                    component: () => import('../components/Set/SystemConfig.vue')
                },
                {
                    path: '/uploadAudio',
                    name: 'uploadAudio',
                    component: () => import('../components/Set/UploadAudio.vue')
                },
                {
                    path: '/createAudio',
                    name: 'createAudio',
                    component: () => import('../components/Set/CreateAudio.vue')
                },
                {
                    path: '/createLyrics',
                    name: 'createLyrics',
                    component: () => import('../components/Set/CreateLyrics.vue')
                },
                {
                    path: '/thanksAuthor',
                    name: 'thanksAuthor',
                    component: () => import('../components/Set/ThanksAuthor.vue')
                }
            ]
        },
    ]
})

export default router